import request from '@/utils/request'
import type { ShopkeeperType, ShopkeeperListResult, SendWsMessageData } from './types'

class APIShopkeeper {
    /** 店主-未登录 */
    static getShopkeeper(type: ShopkeeperType, params?: PageQuery) {
        return request<ShopkeeperListResult[]>('/getShopkeeper', {
            method: 'POST',
            body: { type },
            params
        })
    }
    /** 店主-已登录 */
    static getLoginShopkeeper(type: ShopkeeperType, params?: PageQuery) {
        return request<ShopkeeperListResult[]>('/getLoginShopkeeper', {
            method: 'POST',
            body: { type },
            params
        })
    }

    /** 设置发送获取 socket 信息 */
    static sendWsMessage(data: SendWsMessageData) {
        return request<any>('/ws/init', {
            method: 'POST',
            body: data
        })
    }


}

export default APIShopkeeper
